package getBaiduPaid;

import java.io.File;
import java.io.IOException;

import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Document.OutputSettings;

public class JsoupParse {
    Document doc = null;
    String enc = null;
	//从文件提取，公用方法
		public Document ParseFile (String input) throws IOException {
			File file = new File(input);
			doc = Jsoup.parse(file, enc);
	    	OutputSettings os = doc.outputSettings();
	    	enc = os.charset().toString();
	    	return doc;
		}
		
		//从URL提取，公用方法
		public Document ParseURL (String input) throws IOException {
			return Jsoup.connect(input).get();
		}
}
